﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Janus.BaseEntitys
{
    public class Conditions
    {
        public Conditions()
        {

        }
        /// <summary>
        /// 开始连接符
        /// </summary>
        public string SConnector { get; set; }
        /// <summary>
        /// 字段名称
        /// </summary>
        public string ColName { get; set; }

        private string _operator = string.Empty;
        /// <summary>
        /// 运算符
        /// </summary>
        public string Operator
        {
            get
            {
                if (!string.IsNullOrEmpty(ColName) && string.IsNullOrEmpty(_operator))
                { throw new InvalidCastException("[Operator] could not be null"); }
                return _operator;
            }
            set { _operator = value; }
        }
        /// <summary>
        /// 字段对应值
        /// </summary>
        public string ColValue { get; set; }

        private string _eConnector = string.Empty;
        /// <summary>
        /// 终止连接符
        /// </summary>
        public string EConnector
        {
            get
            {
                return _eConnector;
            }
            set { _eConnector = value; }
        }

        /// <summary>
        /// 逻辑运算符 and/or
        /// </summary>
        public string Logicer { get; set; }
    }
}
